<template>
	<div class="publicpageview">
		<div class="publicformview">
			<el-form label-width="140px" :inline="true" :model="listQuery" size="mini" ref="searchForm">
				<el-row :gutter="10">
					<el-col :span="5">
						<el-form-item label="承租单位：" prop="renter">
							<el-input clearable v-model="listQuery.renter"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="5">
						<el-form-item label="房屋地址：" prop="Addr">
							<el-input clearable v-model="listQuery.Addr"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="5">
						<el-form-item label="业务编号：" prop="FCode">
							<el-input clearable v-model="listQuery.FCode"></el-input>
						</el-form-item>
					</el-col>
					<div v-show='isSearch'>
						<el-col :span="8">
							<el-form-item label="管理部(分中心)核对时间：" prop="FGZManagerDate" label-width="240px">
								<el-date-picker clearable v-model="listQuery.FGZManagerDate" type="date" placeholder="年/月/日">
								</el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="7">
							<el-form-item label="区住建委核查时间：" prop="QGSDate" label-width="170px">
								<el-date-picker clearable v-model="listQuery.QGSDate" type="date" placeholder="年/月/日">
								</el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="5">
							<el-form-item label="合同编号：" prop="ContractNo">
								<el-input clearable v-model="listQuery.ContractNo"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="5">
							<el-form-item label="受让单位：" prop="ownerunit">
								<el-input clearable v-model="listQuery.ownerunit"></el-input>
							</el-form-item>
						</el-col>
					</div>

					<el-col :span="5">
						<div>
							<el-button size="mini" type="primary" @click="chaxun">查询</el-button>
							<el-button size="mini" @click="resetForm">重置</el-button>
						<el-button size="mini" type="primary" @click="isSearch = !isSearch">{{!isSearch?'高级搜索':'关闭搜索'}}</el-button>
						</div>
					</el-col>
				</el-row>
			</el-form>
		</div>

		<div class="publitableview">
			<el-button type="primary" size="mini" @click="handleAddUser('登记')">转让登记</el-button>
			<el-button type="primary" size="mini" @click="handleout">导出</el-button>
			<el-table v-loading="listLoading" :data="list" border fit highlight-current-row size="mini">
				<el-table-column align="center" label="管理部(分中心)" prop="houseAdminName">
				</el-table-column>

				<el-table-column align="center" label="业务编号" prop="zcode">
				</el-table-column>

				<el-table-column align="center" label="承租人" prop="renter">
				</el-table-column>

				<el-table-column align="center" label="房屋地址" prop="addr">
				</el-table-column>

				<el-table-column align="center" label="合同编号" prop="contractno">
				</el-table-column>

				<!-- <el-table-column align="center" label="产别" prop="realway">
				</el-table-column> -->

				<el-table-column align="center" label="房管站核实时间" prop="fgzmanagerdate">
					<template slot-scope="scope">
						{{scope.row.fgzmanagerdate?scope.row.fgzmanagerdate.split(' ')[0]:''}}
					</template>
				</el-table-column>

				<el-table-column align="center" label="状态" prop="state">
					<template slot-scope="scope">
						{{scope.row.state==-1?'区住建委退回':scope.row.state==-2?'抽查不通过':scope.row.state=='00'?'未提交':
						scope.row.state==10?'数据录入完毕':scope.row.state==20?'等待区住建委核查':scope.row.state==40?'抽查通过':
						scope.row.state==50?'区住建委核查通过':''}}
					</template>
				</el-table-column>
				<el-table-column align="center" label="操作" width="240">
					<template slot-scope="scope">
						<el-button v-if="scope.row.state=='00'" type="text" size="mini" @click="handleTijiao(scope.row.zid)">提交</el-button>
						<el-button v-if="scope.row.state=='10'||scope.row.state==-1" type="text" size="mini" @click="handleAddUser('房管',scope.row.zid)">房管站审核</el-button>
						<el-button v-if="scope.row.state=='20'||scope.row.state==-2" type="text" size="mini" @click="handleAddUser('复核',scope.row.zid)">区建委审核</el-button>
						<el-button v-if="scope.row.state=='50'" type="text" size="mini" @click="handleAddUser('审核',scope.row.zid)">抽查</el-button>
						<el-button type="text" size="mini" @click="handleAddUser('修改',scope.row.zid)">修改</el-button>
						<el-button type="text" size="mini" @click="handleAddUser('详情',scope.row.zid)">详情</el-button>
						<el-button type="text" size="mini" @click="handleDelete(scope.row.zid)">删除</el-button>
					</template>
				</el-table-column>
			</el-table>

			<div class="publicpaginationview">
				<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
					:current-page="listQuery.pageNum" background :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.pageSize"
					layout="total, sizes, prev, pager, next, jumper" :total="total" small></el-pagination>
			</div>
		</div>


		<el-dialog :title="dialogName" :visible.sync="shenheVisible" width="80%" :before-close="handleClose"
			style="margin-top: 0px;">
			<el-form :rules='rules' :model="addQuery" :disabled="dialogName=='区公司审核转让'||dialogName=='区公司复核转让'||dialogName=='详情'" ref="addForm" class="demo-ruleForm" label-position="right" label-width="160px">
				<el-row :gutter="24">
					<el-col :span="6">
						<el-form-item label="业务编号：" prop="zcode">
							<el-input v-model="addQuery.zcode"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="房屋地址：" prop="addr">
							<el-input v-model="addQuery.addr"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="合同编号：" prop="contractno">
							<el-input v-model="addQuery.contractno"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="承租单位：" prop="renter">
							<el-input v-model="addQuery.renter"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="受让单位：" prop="ownerunit">
							<el-input v-model="addQuery.ownerunit"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="承租单位身份证号：" prop="renteridno">
							<el-input v-model="addQuery.renteridno"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="受让单位身份证号：" prop="owneridno">
							<el-input v-model="addQuery.owneridno"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="房屋结构：" prop="structure">
							<el-input v-model="addQuery.structure"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="地段等级：" prop="structurelevel">
							<el-input v-model="addQuery.structurelevel"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="租金类别：" prop="rentkind">
							<el-input v-model="addQuery.rentkind"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="租金定额：" prop="realrent">
							<el-input v-model="addQuery.realrent"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="间数：" prop="roomcount">
							<el-input v-model="addQuery.roomcount"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="建筑面积：" prop="area">
							<el-input v-model="addQuery.area"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="评估报告编号：" prop="evaluateno">
							<el-input v-model="addQuery.evaluateno"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="评估单价(元/㎡)：" prop="evaluateprice">
							<el-input v-model="addQuery.evaluateprice"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="出售价格(元)：" prop="sellprice">
							<el-input v-model="addQuery.sellprice"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="计算公式：" prop="transferfee1">
							<el-input v-model="addQuery.transferfee1"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="实收转让费(元)：" prop="transferfee">
							<el-input v-model="addQuery.transferfee"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="转让原因：" prop="transferreason">
							<el-input v-model="addQuery.transferreason"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="文件名称：" prop="floorcount">
							<div v-if="typeName == '登记'" style="line-height: 40px;color: blueviolet;" @click="handleUploadScan">文件上传
							</div>
							<div v-else style="line-height: 40px;color: blueviolet;" @click="handleUploadScan">查看文件</div>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="24">
					<el-col :span="7">
						<el-form-item label="欠租情况：" prop="owe" label-width="100px">
							<div style="display: flex;align-items: center;">
								<el-switch v-model="addQuery.owe" active-value="是" inactive-value="否">
								</el-switch>
								<el-input style="margin-left: 5px;" v-model="addQuery.owe1" placeholder="请说明详细情况"></el-input>
							</div>
						</el-form-item>
					</el-col>
					<el-col :span="7">
						<el-form-item label="违章拆改：" prop="destroy" label-width="100px">
							<div style="display: flex;align-items: center;">
								<el-switch v-model="addQuery.destroy" active-value="是" inactive-value="否">
								</el-switch>
								<el-input style="margin-left: 5px;" v-model="addQuery.destroy1" placeholder="请说明详细情况"></el-input>
							</div>
						</el-form-item>
					</el-col>
					<el-col :span="7">
						<el-form-item label="租凭纠纷：" prop="disagree" label-width="100px">
							<div style="display: flex;align-items: center;">
								<el-switch v-model="addQuery.disagree" active-value="是" inactive-value="否">
								</el-switch>
								<el-input style="margin-left: 5px;" v-model="addQuery.disagree1" placeholder="请说明详细情况"></el-input>
							</div>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="备注：" prop="memo" label-width="100px">
							<el-input v-model="addQuery.memo"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
			</el-form>
			<div class="xinxi" v-if="dialogName!='转让登记'&&dialogName!='详情'&&dialogName!='转让修改'">
				<el-button @click="shenheButton('管理部（分中心）意见')" :class="[shenheName=='管理部（分中心）意见'?'tabButton':'']" type="primary"
					size="medium ">管理部（分中心）意见</el-button>
				<el-button @click="shenheButton('区住房建设行政主管部门意见')" :class="[shenheName=='区住房建设行政主管部门意见'?'tabButton':'']"
					type="primary" size="medium ">区住房建设行政主管部门意见</el-button>
				<el-button @click="shenheButton('抽查情况')" :class="[shenheName=='抽查情况'?'tabButton':'']" type="primary"
					size="medium ">抽查情况</el-button>
			</div>
			<div class="goufangContent" v-if="shenheName=='管理部（分中心）意见'">
				<el-form :model="listQuery" disabled ref="dataForm" class="demo-ruleForm" label-position="right" label-width="160px">
					<el-row :gutter="24">
						<el-col :span="10">
							<el-form-item label="管理部（分中心）负责人意见：" prop="keyword" label-width="240px">
								<el-input v-model="listQuery.keyword"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="负责人：" prop="keyword">
								<el-input v-model="listQuery.keyword"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="经办时间：" prop="keyword">
								<el-input v-model="listQuery.keyword"></el-input>
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
			</div>
			<div class="goufangContent" v-if="shenheName=='区住房建设行政主管部门意见'">
				<el-form :model="listQuery" :disabled="dialogName!='区公司复核转让'" ref="dataForm" class="demo-ruleForm"
					label-position="right" label-width="160px">
					<el-row :gutter="24">
						<el-col :span="6">
							<el-form-item label="核查意见：" prop="qgsview">
								<el-input v-model="fuheQuery.qgsview"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="核查人：" prop="qgscheck">
								<el-input v-model="fuheQuery.qgscheck"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="核查时间：" prop="qgsdate">
								<el-date-picker v-model="fuheQuery.qgsdate" type="date" placeholder="年/月/日">
								</el-date-picker>
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
			</div>
			<div class="goufangContent" v-if="shenheName=='抽查情况'">
				<el-form :model="listQuery" :disabled="dialogName!='区公司审核转让'" ref="dataForm" class="demo-ruleForm" label-position="right" label-width="160px">
					<el-row :gutter="24">
						<el-col :span="6">
							<el-form-item label="抽查意见：" prop="zgsview">
								<el-input v-model="shenheQuery.zgsview"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="抽查人：" prop="zgscheck">
								<el-input v-model="shenheQuery.zgscheck"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="抽查时间：" prop="zgsdate">
								<el-date-picker v-model="shenheQuery.zgsdate" type="date" placeholder="年/月/日">
								</el-date-picker>
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
			</div>


			<div class="saveContent">
				<el-button v-if="dialogName=='详情'" type="primary" @click="shenheVisible = false" size="medium">返回</el-button>
				<el-button v-else type="primary" @click="save" size="medium">保 存</el-button>
			</div>

		</el-dialog>

	</div>
</template>

<script>
	import dayjs from 'dayjs'
	import * as XLSX from 'xlsx'
	import {
		zhuanrangList,
		addzhuanrang,
		zhuanrangSubmit,
		zhuanrangData,
		updzhuanrang,
		delZhuanrang
	} from '@/api/management'
	import managementFileUpload from '@/components/managementFileUpload.vue';
	export default {
		name: "managementzujincuishou",
		components: {
			managementFileUpload
		},
		data() {
			return {
				listQuery: {
					pageNum: 1,
					pageSize: 20,
					State: '',
					Addr: '',
					FCode: '',
					FGZManagerDate: '',
					QGSDate: '',
					ownerunit: '',
					renter: ''
				},
				total: 0,
				options: [{
					key: "1"
				}],
				list: [],
				addQuery: {
					zcode:'',
					addr:'',
					contractno:'',
					renter:'',
					ownerunit:'',
					renteridno:'',
					owneridno:'',
					structure:'',
					structurelevel:'',
					rentkind:'',
					realrent:'',
					roomcount:'',
					area:'',
					evaluateno:'',
					evaluateprice:'',
					sellprice:'',
					transferfee1:'',
					transferfee:'',
					transferreason:"",
					ImgUpload:[],
					owe:'否',
					owe1:'',
					destroy:"否",
					destroy1:'',
					disagree:'否',
					disagree1:'',
					memo:''
				},
				rules: {
					zcode: [
						{ required: true, message: '请输入业务编号', trigger: 'blur' }
					],
					owner: [
						{ required: true, message: '请输入承租人', trigger: 'blur' }
					],
					addr: [
						{ required: true, message: '请输入房屋地址', trigger: 'blur' }
					],
					contractno: [
						{ required: true, message: '请输入合同编号', trigger: 'blur' }
					],
					renter: [
						{ required: true, message: '请输入承租单位', trigger: 'blur' }
					],
					ownerunit: [
						{ required: true, message: '请输入受让单位', trigger: 'blur' }
					],
					renteridno: [
						{ required: true, message: '请输入承租单位身份证号', trigger: 'blur' }
					],
					owneridno: [
						{ required: true, message: '请输入受让单位身份证号', trigger: 'blur' }
					],
					structure: [
						{ required: true, message: '请输入房屋结构', trigger: 'blur' }
					],
					structurelevel: [
						{ required: true, message: '请输入地段等级', trigger: 'blur' }
					],
					rentkind: [
						{ required: true, message: '请输入租金类别', trigger: 'blur' }
					],
					realrent: [
						{ required: true, message: '请输入租金定额', trigger: 'blur' }
					],
					roomcount: [
						{ required: true, message: '请输入间数', trigger: 'blur' }
					],
					area: [
						{ required: true, message: '请输入建筑面积', trigger: 'blur' }
					],
					evaluateno: [
						{ required: true, message: '请输入评估报告编号', trigger: 'blur' }
					],
					evaluateprice: [
						{ required: true, message: '请输入评估单价(元/㎡)', trigger: 'blur' }
					],
					sellprice: [
						{ required: true, message: '请输入出售价格(元)', trigger: 'blur' }
					],
					transferfee1: [
						{ required: true, message: '请输入计算公式', trigger: 'blur' }
					],
					transferfee: [
						{ required: true, message: '请输入实收转让费(元)', trigger: 'blur' }
					],
					transferreason: [
						{ required: true, message: '请输入转让原因', trigger: 'blur' }
					],
					memo: [
						{ required: true, message: '请输入备注', trigger: 'blur' }
					],
				
				},
				fuheQuery: {
					qgsview: '',
					qgscheck: '',
					qgsdate: ''
				},
				shenheQuery: {
					zgsdate: '',
					zgsview: '',
					zgscheck: ''
				},
				newAddQuery:{},
				listLoading: false,
				dialogVisible: false,
				shenheVisible: false,
				shenheName: '经营管理意见',
				type: '',
				uploadDialogVisible: false,
				dialogName: '',
				typeName: '',
				zid:'',
				isSearch:false
			};
		},

		computed: {},

		mounted() {
			this.newAddQuery = JSON.stringify(this.addQuery)
				this.zhuanrangList()
		},

		methods: {
			shenheButton(type) {
				this.shenheName = type
			},
			chaxun() {
				this.zhuanrangList()
			},
			zhuanrangList() {
				this.listLoading = true;
				let data = {
					pageNum: this.listQuery.pageNum,
					pageSize: this.listQuery.pageSize,
					State: '50',
					Addr: this.listQuery.Addr,
					FCode: this.listQuery.FCode,
					ownerunit: this.listQuery.ownerunit,
					renter: this.listQuery.renter,
					FGZManagerDate: this.listQuery.FGZManagerDate ? dayjs(this.listQuery.FGZManagerDate).format(
						'YYYY-MM-DD HH:mm:ss') : '',
					QGSDate: this.listQuery.FGZManagerDate ? dayjs(this.listQuery.QGSDate).format('YYYY-MM-DD HH:mm:ss') : ''
				}
				zhuanrangList(data).then((response) => {
					this.total = response.data.total;
					this.list = response.data.list;
					this.listLoading = false;
				});
			},
			handleSizeChange(val) {
				this.listQuery.pageNum = 1;
				this.listQuery.pageSize = val;
				this.zhuanrangList()
			},
			handleCurrentChange(val) {
				this.listQuery.pageNum = val;
				this.zhuanrangList()
			},

			resetForm() {
				this.listQuery.pageNum = 1,
					this.listQuery.pageSize = 20,
					this.listQuery.State = '',
					this.listQuery.Addr = '',
					this.listQuery.FCode = '',
					this.listQuery.FGZManagerDate = '',
					this.listQuery.QGSDate = '',
					this.listQuery.ownerunit = '',
					this.listQuery.renter = ''
			},
			// 提交
			handleTijiao(zid) {
				this.$confirm('请确认是否提交当前转让申请至“区公司”复核？', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					let data = {
						ZID: zid
					}
					zhuanrangSubmit(data).then(res => {
						this.$message({
							type: 'success',
							message: '提交成功!'
						});
				this.zhuanrangList()
					})
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消提交'
					});
				});
			},

			handleAddUser(name,zid) {
				this.zid = zid
				if (name == '复核') {
					this.dialogName = '区公司复核转让'
					this.shenheName = '区住房建设行政主管部门意见'
				} else if (name == '审核') {
					this.dialogName = '区公司审核转让'
					this.shenheName = '抽查情况'
				} else if (name == '修改') {
					this.dialogName = '转让修改'
					this.shenheName = ''
				} else if (name == '登记') {
					this.dialogName = '转让登记'
					this.shenheName = ''
				} else if (name == '详情') {
					this.dialogName = '详情'
					this.shenheName = ''
				} else if (name=='房管'){
					this.dialogName = '房管站审核'
				}
				this.typeName = name
				this.$router.push({
				  path: '/management/chengzuhuguanli/zhuanrangguanliluru',
				  query: { dialogName: this.dialogName,zid:zid}
				})
			},
			// 保存
			save() {
				
				
				this.$refs.addForm.validate((valid) => {
				if (valid) {
					if (this.dialogName == '转让登记') {
						this.addzhuanrang()
					} else if (this.dialogName == '转让修改' || this.dialogName == '区公司复核转让' || this.dialogName == '区公司审核转让') {
						this.updzhuanrang()
					}
				} else {
					console.log('验证失败！');
					return false;
					}
				}); 
			},
			// 登记
			addzhuanrang() {
				let data = this.addQuery
				this.listLoading = true;
				addzhuanrang(data).then(res => {
					this.rester()
					this.listLoading = false;
					this.shenheVisible = false
					this.zhuanrangList()
					this.$message({
						type: 'success',
						message: '操作成功!'
					});
				})
			},
			handleUpdate(currentData) {
				//   一定要在打开弹窗前 再赋值 不然resetFiles没用
				this.dialogVisible = true;
				this.$nextTick(() => {
					this.formData = {
						...currentData
					};
				});
			},
			// 修改
			updzhuanrang() {
				let data
				if (this.dialogName == '转让修改') {
					data = this.addQuery
				} else if (this.dialogName == '区公司审核转让') {
					data = this.shenheQuery
					if (data.zgsdate) {
						data.zgsdate = dayjs(data.zgsdate).format('YYYY-MM-DD HH:mm:ss')
					}
				} else if (this.dialogName == '区公司复核转让') {
					data = this.fuheQuery
					if (data.qgsdate) {
						data.qgsdate = dayjs(data.qgsdate).format('YYYY-MM-DD HH:mm:ss')
					}
				}
				data.zid = this.zid
				this.listLoading = true;
				updzhuanrang(data).then(res => {
					console.log(res)
					this.rester()
					this.listLoading = false;
					this.shenheVisible = false
					this.zhuanrangList()
					this.$message({
						type: 'success',
						message: '操作成功!'
					});
				})
			},
			// 重置
			rester() {
				this.addQuery = JSON.parse(this.newAddQuery)
			},
			handleDelete(zid) {
				this.$confirm('此操作将删除该条内容，请确认是否继续操作？', '删除提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					let data = {
						ZID: zid
					}
					delZhuanrang(data).then(res => {
						console.log(res)
						this.zhuanrangList()
						this.$message({
							type: 'success',
							message: '删除成功!'
						});
					})
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消删除'
					});
				});
			},
			handleClose(done) {
				this.$confirm('确认关闭？')
					.then(_ => {
						done();
					})
					.catch(_ => {});
			},
			// 详情
			zhuanrangData() {
				let data = {
					ZID: this.zid
				}
				zhuanrangData(data).then(res => {
					console.log(res)
					this.addQuery = res.data
					this.addQuery.jizumianji = res.data.singlearea + res.data.mixarea
					this.fuheQuery.qgsview = res.data.qgsview,
						this.fuheQuery.qgscheck = res.data.qgscheck,
						this.fuheQuery.qgsdate = res.data.qgsdate
					this.shenheQuery.zgsdate = res.data.zgsdate,
						this.shenheQuery.zgsview = res.data.zgsview,
						this.shenheQuery.zgscheck = res.data.zgscheck
				})
			},
			
			
			// 扫描件上传
			handleUploadScan() {
				console.log(1)
				this.uploadDialogVisible = true;
			},
			uploadClose(){
				this.uploadDialogVisible = false
			},
			uploadConfirm(fileList){
				let ImgUpload = []
				fileList.forEach((item,index)=>{
					ImgUpload.push(item.response.data.url)
				})
				this.addQuery.ImgUpload = JSON.stringify(ImgUpload)
				this.uploadDialogVisible = false
			},
			handleout() {
				this.$confirm('此操作将导出该条内容，请确认是否继续操作？', '导出提示', {
						confirmButtonText: '确定',
						cancelButtonText: '取消',
						type: 'warning'
					})
					.then(() => {
						let data = {
							pageNum: this.listQuery.pageNum,
							pageSize: this.listQuery.pageSize,
							State: this.listQuery.State,
							Addr: this.listQuery.Addr,
							FCode: this.listQuery.FCode,
							ownerunit: this.listQuery.ownerunit,
							renter: this.listQuery.renter,
							FGZManagerDate: this.listQuery.FGZManagerDate ? dayjs(this.listQuery.FGZManagerDate).format(
								'YYYY-MM-DD HH:mm:ss') : '',
							QGSDate: this.listQuery.FGZManagerDate ? dayjs(this.listQuery.QGSDate).format('YYYY-MM-DD HH:mm:ss') : ''
						}
						zhuanrangList(data).then((response) => {
							let list = response.data.list
							let outList = []
							list.forEach((item, index) => {
								outList.push({
									'管理部(分中心)': item.houseAdminName,
									'业务编号': item.zcode,
									'承租人': item.renter,
									'房屋地址': item.addr,
									'合同编号': item.contractno,
									'产别': item.realway,
									'房管站核实时间':item.fgzmanagerdate?item.fgzmanagerdate.split(' ')[0]:'',
									'状态':item.state==-1?'区住建委退回':item.state==-2?'抽查不通过':item.state=='00'?'未提交':
									item.state==10?'数据录入完毕':item.state==20?'等待区住建委核查':item.state==40?'抽查通过':
									item.state==50?'区住建委核查通过':''
								})
							})
							
							// 获取表格数据
							const data = outList
							// 转换数据为工作表
							const worksheet = XLSX.utils.json_to_sheet(data)
							// 创建新的工作簿
							const workbook = XLSX.utils.book_new()
							// 将工作表添加到工作簿
							XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1')
							// 导出Excel文件
							XLSX.writeFile(workbook, '所资料.xlsx')
						})
					})
					.catch(() => {
						this.$message({
							type: 'info',
							message: '已取消导出'
						})
					})
			}
		},
	};
</script>
<style scoped>
	.tianjiaButton {
		border: 2px solid #008C93;
		background-color: #fff;
		color: #008C93;
	}

	.xinxi {
		display: flex;
		width: 800px;
	}

	.goufangContent {
		width: 100%;
		box-sizing: border-box;
		padding: 20px;
		background-color: #F7F7F7;
	}

	.tabButton {
		background: #EFF2F7;
		color: #333333;
		border: none;
	}

	.saveContent {
		width: 100%;
		display: flex;
		justify-content: end;
		margin-top: 20px;
		padding-bottom: 20px;
	}

	/deep/.el-input__inner {
		height: 30px !important;
		line-height: 30px !important;
	}

	/deep/.el-form-item__label {
		height: 30px !important;
	}

	/dee/.el-date-editor {
		width: 120px !important;
	}
</style>